﻿<UserControl x:Class="Assembly.Metro.Controls.PageTemplates.Games.HaloMap"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
			 xmlns:Components="clr-namespace:Assembly.Metro.Controls.PageTemplates.Games.Components"
             xmlns:DataBind="clr-namespace:Assembly.Metro.Controls.PageTemplates.Games"
			 xmlns:CloseableTab="clr-namespace:CloseableTabItemDemo"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:WP7="clr-namespace:Assembly.Metro.Controls.WP7Controls"
			 xmlns:MetroTabs="clr-namespace:CloseableTabItemDemo"
             mc:Ignorable="d" 
             Background="#28282b"
             d:DesignWidth="1000" d:DesignHeight="600">
    <Grid>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition x:Name="colLeft" Width="0.300*" />
                <ColumnDefinition x:Name="colRight" Width="0.700*" />
            </Grid.ColumnDefinitions>
            
            <Grid x:Name="sideBar" Grid.Column="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="#2d2d30">
                <TabControl x:Name="mapInfoSelection" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}" Margin="0">
                    <TabItem Header="Map Information" Style="{StaticResource MetroHeaderTabItem}" Height="15.96" Margin="18,0,-18,-15" VerticalAlignment="Bottom">
                        <Grid>
                            <TextBlock x:Name="lblMapName" FontFamily="{DynamicResource MetroFontLight}" Text="" Foreground="White" FontSize="32" Margin="25,35.5,7,0" Height="50" VerticalAlignment="Top" TextTrimming="CharacterEllipsis" />
                            <ed:RegularPolygon Fill="#FF4A4A4C" HorizontalAlignment="Left" Height="19" InnerRadius="1" Margin="-18,51,0,0" PointCount="3" Stretch="Fill" VerticalAlignment="Top" Width="48" RenderTransformOrigin="0.5,0.5">
                                <ed:RegularPolygon.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform/>
                                        <SkewTransform/>
                                        <RotateTransform Angle="90"/>
                                        <TranslateTransform/>
                                    </TransformGroup>
                                </ed:RegularPolygon.RenderTransform>
                            </ed:RegularPolygon>

                            <Rectangle Fill="#FF363639" Height="1" Width="250" Margin="25,114.25,25,0" VerticalAlignment="Top" d:LayoutOverrides="Height" />

                            <ScrollViewer Margin="25,130,20,110" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                                <StackPanel>
                                    <TextBlock x:Name="lblMapHeader" FontFamily="{DynamicResource MetroFontSemiLight}" Text="" Foreground="White" FontSize="16" />
                                    <StackPanel x:Name="listMapHeader" Margin="0,0,0,5">

                                    </StackPanel>
                                </StackPanel>
                            </ScrollViewer>
                            <Button x:Name="btnEditorsScript" Content="Script Editor" Margin="25,10,20,65" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Click="btnEditorsScript_Click" />
                            <Button x:Name="btnEditorsString" Content="StringID Viewer" Margin="25,10,20,25" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Click="btnEditorsString_Click" />
                        </Grid>
                    </TabItem>

                    <TabItem Header="Tags" Style="{StaticResource MetroHeaderTabItem}" Height="15.96" Margin="18,0,-18,-15" VerticalAlignment="Bottom">
                        <Grid>
                            <TreeView x:Name="tvTagList" Margin="15, 40, 15, 50" SelectedItemChanged="tvTagList_SelectedTagChanged" ItemsSource="{Binding}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="{x:Null}" BorderBrush="{DynamicResource ExtryzeAccentBrushSecondary}" BorderThickness="2" Foreground="White"
                                      VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard">
                                <TreeView.Resources>
                                    <HierarchicalDataTemplate DataType="{x:Type  DataBind:TagClass}" ItemsSource="{Binding Children}" >
                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                                            <TextBlock Text="{Binding TagClassMagic}" />
                                        </StackPanel>
                                    </HierarchicalDataTemplate>
                                    <DataTemplate DataType="{x:Type DataBind:TagEntry}">
                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                                            <StackPanel.ContextMenu>
                                                <ContextMenu>
                                                    <MenuItem Header="Rename Tagname" />
                                                    <MenuItem Header="Overwrite Meta" />
                                                    <Separator />
                                                    <MenuItem Header="Duplicate Tag" />
                                                    <MenuItem Header="Tag Manipulation" />
                                                    <Separator />
                                                    <MenuItem Header="Go to Raw Editor" />
                                                </ContextMenu>
                                            </StackPanel.ContextMenu>
                                            <TextBlock Text="{Binding TagFileName}" />
                                        </StackPanel>
                                    </DataTemplate>
                                </TreeView.Resources>
                                <TreeView.ItemContainerStyle>
                                    <Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource {x:Type TreeViewItem}}">
                                        <EventSetter Event="MouseDoubleClick" Handler="tvTagList_ItemDoubleClick" />
                                    </Style>
                                </TreeView.ItemContainerStyle>
                            </TreeView>

                            <CheckBox x:Name="cbShowEmptyTags" Content="Show unused classes" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Margin="25,10,0,20" Unchecked="cbShowEmptyTags_Altered" Checked="cbShowEmptyTags_Altered"/>
                        </Grid>
                    </TabItem>
                    
                    <TabItem Header="Locales" Style="{StaticResource MetroHeaderTabItem}" Height="15.96" Margin="18,0,-18,-15" VerticalAlignment="Bottom">
                        <Grid Margin="25,30,25,30">
                            <TextBlock FontFamily="{DynamicResource MetroFontSemiLight}" Text="Languages;" Foreground="White" FontSize="16" />
                            <ListBox x:Name="lbLanguages" Margin="0,25,0,0" BorderBrush="{x:Null}" Background="{x:Null}" VerticalAlignment="Stretch" ScrollViewer.CanContentScroll="False">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <Button Name="PART_Button" HorizontalAlignment="Stretch" Click="LocaleButtonClick">
                                            <Button.Template>
                                                <ControlTemplate TargetType="{x:Type Button}">
                                                    <Border Background="Transparent" HorizontalAlignment="Stretch">
                                                        <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Center" />
                                                    </Border>
                                                </ControlTemplate>
                                            </Button.Template>
                                            <Button.Style>
                                                <Style TargetType="{x:Type Button}">
                                                    <Setter Property="Height" Value="Auto" />
                                                </Style>
                                            </Button.Style>
                                            <StackPanel>
                                                <TextBlock Text="{Binding Name}" FontSize="20">
                                                    <TextBlock.Style>
                                                        <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource GenericTextblock}">
                                                            <Setter Property="Foreground" Value="{DynamicResource ExtryzeAccentBrush}" />
                                                            <Style.Triggers>
                                                                <MultiDataTrigger>
                                                                    <MultiDataTrigger.Conditions>
                                                                        <Condition Binding="{Binding ElementName=PART_Button, Path=IsMouseOver}" Value="True" />
                                                                        <Condition Binding="{Binding ElementName=PART_Button, Path=IsPressed}" Value="False" />
                                                                    </MultiDataTrigger.Conditions>
                                                                    <Setter Property="Foreground" Value="{DynamicResource ExtryzeAccentBrushSecondary}" />
                                                                </MultiDataTrigger>
                                                            </Style.Triggers>
                                                        </Style>
                                                    </TextBlock.Style>
                                                </TextBlock>
                                                <TextBlock FontSize="12">
                                                    <Run Text="{Binding Base.StringCount, Mode=OneWay}"/><Run Text=" strings"/>
                                                    <TextBlock.Style>
                                                        <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource GenericTextblock}">
                                                            <Setter Property="Foreground" Value="{DynamicResource TextBrushSecondary}" />
                                                            <Style.Triggers>
                                                                <MultiDataTrigger>
                                                                    <MultiDataTrigger.Conditions>
                                                                        <Condition Binding="{Binding ElementName=PART_Button, Path=IsMouseOver}" Value="True" />
                                                                        <Condition Binding="{Binding ElementName=PART_Button, Path=IsPressed}" Value="False" />
                                                                    </MultiDataTrigger.Conditions>
                                                                    <Setter Property="Foreground" Value="{DynamicResource TextBrushPrimary}" />
                                                                </MultiDataTrigger>
                                                            </Style.Triggers>
                                                        </Style>
                                                    </TextBlock.Style>
                                                </TextBlock>
                                            </StackPanel>
                                        </Button>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                                <ListBox.ItemContainerStyle>
                                    <Style TargetType="{x:Type ListBoxItem}">
                                        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate>
                                                    <ContentPresenter Margin="8,5"
                                                        Content="{TemplateBinding ContentControl.Content}"
                                                        ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
                                                        ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
                                                        HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
                                                        VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
                                                        SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"/>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </ListBox.ItemContainerStyle>
                            </ListBox>
                        </Grid>
                    </TabItem>
                </TabControl>
            </Grid>
            <GridSplitter Width="2" Background="#FF545456" Foreground="{x:Null}" ResizeDirection="Columns" />
            <Grid x:Name="mainContent" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0,0,0,0">
            	<TabControl x:Name="contentTabs" Background="{x:Null}" BorderBrush="{DynamicResource ExtryzeAccentBrush}" Foreground="White" BorderThickness="0,2,0,0" Margin="0" Padding="2">
					
				</TabControl>
			</Grid>
        </Grid>
        
        <Grid x:Name="doingAction" Background="#BC2D2D30" Visibility="Collapsed">
            <TextBlock x:Name="lblDoingAction" FontFamily="{DynamicResource MetroFontRegular}" Text="Loading Map..." Foreground="#FF878787" FontSize="13.333" Margin="0,10,0,0" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Top" />
            <ProgressBar Height="4" VerticalAlignment="Top" HorizontalAlignment="Stretch" IsIndeterminate="True" />
		</Grid>
    </Grid>
</UserControl>